package com.ys.enume.advanced;

/**
 * @EnumName   亚马逊销售伙伴campaignBiddingStrategy
 * @Description TODO
 * @Author alula
 * @Date 2023-12-01 15:45
 */
public enum CampaignBiddingStrategyEnum {
    /**
     * 固定竞价
     */
    MANUAL("manual", "固定竞价"),
    /**
     * 动态竞价
     */
    OPTIMIZEFORSALES("optimizeForSales", "动态竞价"),
    /**
     * 遗留
     */
    LEGACY("legacy", "遗留"),
    ;

    private final String code;

    private final String name;

    CampaignBiddingStrategyEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static CampaignBiddingStrategyEnum getEnumByCode(String code) {
        for (CampaignBiddingStrategyEnum marketplaceEnum : values()) {
            if (marketplaceEnum.getCode().equalsIgnoreCase(code)) {
                return marketplaceEnum;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

}
